package com.user.controllet;

import com.user.pojo.Position;
import com.user.pojo.data;
import com.user.reuslt.Result;
import com.user.service.PositionService;
import com.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("Positon")
@CrossOrigin
public class positonCotroller
{
    @Autowired
    private PositionService positionService;

    @PostMapping("query")
    public Result queryPositon(@RequestBody data data)
    {
        Result result = positionService.queryPositon(data);
        return result;
    }
    @PostMapping("insertPositon")
    public Result insertPositon(@RequestBody Position position)
    {
        Result result = positionService.Insertposition(position);
        return result;
    }

    @PostMapping("updatePositon")
    public Result updatePositon(@RequestBody data data)
    {
        Result result = positionService.Updateposition(data);
        return result;
    }

    @PostMapping("delete")
    public Result delete(@RequestBody data data)
    {
        Result result = positionService.DeleteService(data);
        return result;
    }
}
